/*
 * @Description  : verilog code from HUIYU
 * @authorName   : GuoJi
 * @github       : https://github.com/guoji-kk
 * @gitee        : https://gitee.com/guoji13663585559
 * @email        : 13663585559@163.com
 * @version      : 1.0
 * @Date         : 2023-06-02 10:27:46
 * @LastEditTime : 2023-06-02 10:32:42
 */


module substitution(data_o,data_i); // Present cipher uses 16 S-Boxes in parallel to process the data
                                    // this module implements those 16 S-Boxes using the sbox module


output wire [63:0] data_o;
input  wire [63:0] data_i;

sbox substitution_sbox1 (.data_o(data_o[ 3: 0]),.data_i(data_i[ 3: 0]));    
sbox substitution_sbox2 (.data_o(data_o[ 7: 4]),.data_i(data_i[ 7: 4]));   
sbox substitution_sbox3 (.data_o(data_o[11: 8]),.data_i(data_i[11: 8]));   
sbox substitution_sbox4 (.data_o(data_o[15:12]),.data_i(data_i[15:12]));  

sbox substitution_sbox5 (.data_o(data_o[19:16]),.data_i(data_i[19:16]));    
sbox substitution_sbox6 (.data_o(data_o[23:20]),.data_i(data_i[23:20]));   
sbox substitution_sbox7 (.data_o(data_o[27:24]),.data_i(data_i[27:24]));   
sbox substitution_sbox8 (.data_o(data_o[31:28]),.data_i(data_i[31:28]));  

sbox substitution_sbox9 (.data_o(data_o[35:32]), .data_i(data_i[35:32]));
sbox substitution_sbox10 (.data_o(data_o[39:36]), .data_i(data_i[39:36]));
sbox substitution_sbox11 (.data_o(data_o[43:40]), .data_i(data_i[43:40]));
sbox substitution_sbox12 (.data_o(data_o[47:44]), .data_i(data_i[47:44]));

sbox substitution_sbox13 (.data_o(data_o[51:48]), .data_i(data_i[51:48]));
sbox substitution_sbox14 (.data_o(data_o[55:52]), .data_i(data_i[55:52]));
sbox substitution_sbox15 (.data_o(data_o[59:56]), .data_i(data_i[59:56]));
sbox substitution_sbox16 (.data_o(data_o[63:60]), .data_i(data_i[63:60]));



endmodule